package com.alibaba.nacos;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * ClassName: NacosServerApplication
 * Description: Nacos 启动类
 * 1、引用的 nacos console 源码运行，简化开发
 * 2、生产建议从官网下载最新版配置运行
 * <p>
 * Date: 2021/7/25 23:03 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
@Slf4j
@ServletComponentScan
@EnableScheduling

@SpringBootApplication(scanBasePackages = {"com.alibaba.nacos.console", "com.alibaba.nacos.naming", "com.alibaba.nacos.core"})
public class NacosServerApplication {
    /**
     * 是否单机模式启动
     */
    private static String standalone = "true";

    /**
     * 是否开启鉴权
     */
    private static String enabled = "false";


    public static void main(String[] args) {
        System.setProperty("nacos.standalone", standalone);
        System.setProperty("nacos.core.auth.enabled", enabled);
        System.setProperty("server.tomcat.basedir", "/Data/");
        SpringApplication.run(NacosServerApplication.class, args);
        log.info("~~~~~~~~~ Nacos Server application is started ~~~~~~~~~");
    }


}
